import request from '@/utils/request'

// 根据ID查询部门详情
export function getDepartments(token) {
  return request({
    url: '/api/company/department',
    method: 'get',
    params: { token }
  })
}

// 获取员工简单列表
export function getEmployeeSimple() {
  return request.get('/api/sys/user/simple')
}

// 新增部门列表
export function addDepartments(data) {
  return request.post('/api/company/department', data)
}

// 根据ID删除部门
export function delDepartment(id) {
  return request.delete('/api/company/department/' + id) // 这里记得路径最后要打一个/
}

// 查询企业的部门列表
export function getDepartDetail(id) {
  return request.get('/api/company/department/' + id) // 这里记得路径最后要打一个/
}

// 根据ID修改部门详情
export function updateDepartments(data) {
  return request.put(`/api/company/department/${data.id}`, data)
}

